<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libfuse: include/cuse_lowlevel.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libfuse
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">cuse_lowlevel.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">  CUSE: Character device in Userspace</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">  Copyright (C) 2008-2009  SUSE Linux Products GmbH</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">  Copyright (C) 2008-2009  Tejun Heo &lt;tj@kernel.org&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">  This program can be distributed under the terms of the GNU LGPLv2.</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">  See the file COPYING.LIB.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">  Read example/cusexmp.c for usages.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef CUSE_LOWLEVEL_H_</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define CUSE_LOWLEVEL_H_</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#ifndef FUSE_USE_VERSION</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#define FUSE_USE_VERSION 29</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fuse__lowlevel_8h.html">fuse_lowlevel.h</a>&quot;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;fcntl.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;sys/types.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;sys/uio.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define CUSE_UNRESTRICTED_IOCTL         (1 &lt;&lt; 0) </span><span class="comment">/* use unrestricted ioctl */</span><span class="preprocessor"></span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keyword">struct </span>fuse_session;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">struct </span>cuse_info {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordtype">unsigned</span>        dev_major;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <span class="keywordtype">unsigned</span>        dev_minor;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <span class="keywordtype">unsigned</span>        dev_info_argc;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">char</span>      **dev_info_argv;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        <span class="keywordtype">unsigned</span>        flags;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;};</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment"> * Most ops behave almost identically to the matching fuse_lowlevel</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment"> * ops except that they don&#39;t take @ino.</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment"> * init_done    : called after initialization is complete</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment"> * read/write   : always direct IO, simultaneous operations allowed</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment"> * ioctl        : might be in unrestricted mode depending on ci-&gt;flags</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">struct </span>cuse_lowlevel_ops {</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        void (*init) (<span class="keywordtype">void</span> *userdata, <span class="keyword">struct </span><a class="code" href="structfuse__conn__info.html">fuse_conn_info</a> *conn);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        void (*init_done) (<span class="keywordtype">void</span> *userdata);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        void (*destroy) (<span class="keywordtype">void</span> *userdata);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        void (*open) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        void (*read) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keywordtype">size_t</span> size, off_t off,</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                      <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        void (*write) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keyword">const</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> size, off_t off,</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                       <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        void (*<a class="code" href="structfuse__file__info.html#a9c1571cb4b6be75827f48aac5891606c">flush</a>) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        void (*release) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        void (*fsync) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keywordtype">int</span> datasync, <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        void (*ioctl) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keywordtype">int</span> cmd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                       <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structfuse__file__info.html#ae7d31802727be19670193a411647bca5">flags</a>,</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                       <span class="keyword">const</span> <span class="keywordtype">void</span> *in_buf, <span class="keywordtype">size_t</span> in_bufsz, <span class="keywordtype">size_t</span> out_bufsz);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        void (*poll) (<a class="code" href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a> req, <span class="keyword">struct </span><a class="code" href="structfuse__file__info.html">fuse_file_info</a> *fi,</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                      <span class="keyword">struct </span>fuse_pollhandle *ph);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;};</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">struct </span>fuse_session *cuse_lowlevel_new(<span class="keyword">struct</span> <a class="code" href="structfuse__args.html">fuse_args</a> *args,</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                                       <span class="keyword">const</span> <span class="keyword">struct</span> cuse_info *ci,</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                                       <span class="keyword">const</span> <span class="keyword">struct</span> cuse_lowlevel_ops *clop,</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                                       <span class="keywordtype">void</span> *userdata);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keyword">struct </span>fuse_session *cuse_lowlevel_setup(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[],</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                                         <span class="keyword">const</span> <span class="keyword">struct</span> cuse_info *ci,</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                                         <span class="keyword">const</span> <span class="keyword">struct</span> cuse_lowlevel_ops *clop,</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                                         <span class="keywordtype">int</span> *multithreaded, <span class="keywordtype">void</span> *userdata);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keywordtype">void</span> cuse_lowlevel_teardown(<span class="keyword">struct</span> fuse_session *se);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="keywordtype">int</span> cuse_lowlevel_main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[], <span class="keyword">const</span> <span class="keyword">struct</span> cuse_info *ci,</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                       <span class="keyword">const</span> <span class="keyword">struct</span> cuse_lowlevel_ops *clop, <span class="keywordtype">void</span> *userdata);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* CUSE_LOWLEVEL_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structfuse__conn__info_html"><div class="ttname"><a href="structfuse__conn__info.html">fuse_conn_info</a></div><div class="ttdef"><b>Definition:</b> <a href="fuse__common_8h_source.html#l00343">fuse_common.h:343</a></div></div>
<div class="ttc" id="fuse__lowlevel_8h_html_a33e2aa4a8905a05397292ae047cd2257"><div class="ttname"><a href="fuse__lowlevel_8h.html#a33e2aa4a8905a05397292ae047cd2257">fuse_req_t</a></div><div class="ttdeci">struct fuse_req * fuse_req_t</div><div class="ttdef"><b>Definition:</b> <a href="fuse__lowlevel_8h_source.html#l00049">fuse_lowlevel.h:49</a></div></div>
<div class="ttc" id="structfuse__file__info_html"><div class="ttname"><a href="structfuse__file__info.html">fuse_file_info</a></div><div class="ttdef"><b>Definition:</b> <a href="fuse__common_8h_source.html#l00037">fuse_common.h:37</a></div></div>
<div class="ttc" id="structfuse__file__info_html_ae7d31802727be19670193a411647bca5"><div class="ttname"><a href="structfuse__file__info.html#ae7d31802727be19670193a411647bca5">fuse_file_info::flags</a></div><div class="ttdeci">int flags</div><div class="ttdef"><b>Definition:</b> <a href="fuse__common_8h_source.html#l00039">fuse_common.h:39</a></div></div>
<div class="ttc" id="structfuse__file__info_html_a9c1571cb4b6be75827f48aac5891606c"><div class="ttname"><a href="structfuse__file__info.html#a9c1571cb4b6be75827f48aac5891606c">fuse_file_info::flush</a></div><div class="ttdeci">unsigned int flush</div><div class="ttdef"><b>Definition:</b> <a href="fuse__common_8h_source.html#l00056">fuse_common.h:56</a></div></div>
<div class="ttc" id="fuse__lowlevel_8h_html"><div class="ttname"><a href="fuse__lowlevel_8h.html">fuse_lowlevel.h</a></div></div>
<div class="ttc" id="structfuse__args_html"><div class="ttname"><a href="structfuse__args.html">fuse_args</a></div><div class="ttdef"><b>Definition:</b> <a href="fuse__opt_8h_source.html#l00109">fuse_opt.h:109</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
